package com.open.exam.common;

/**
 * @Description 缓存key
 * @Author 奶茶
 * Created by on 2018/9/6 9:09.
 */
public class CacheKey {

    /**
     * 获取考生试卷key
     * @param examPlanID 考试计划标示
     * @param subjectID 科目标示
     * @param sceneID 场次标示
     * @param examinerID 考生标示
     * @return
     */
    public static String getExaminerPaperKey(String examPlanID,String subjectID,String sceneID,String examinerID){
        return String.format("%s:%s:%s:%s",examPlanID,subjectID,sceneID,examinerID);
    }

    /**
     * 生成试卷key
     * @param examPlanID
     * @param subjectID
     * @param paperID
     * @return
     */
    public static String getPaperKey(String examPlanID,String subjectID,String paperID){
        return String.format("%s:%s:%s",examPlanID,subjectID,paperID);
    }


    /**
     * 获取考生登录详情key
     * @param examPlanID 考试计划标示
     * @param examinerID 考生标示
     * @param deploymentMode 部署方式
     * @return
     */
    public static String getExaminerLoginInfoKey(String examPlanID,String examinerID,Integer deploymentMode){
        return String.format("%s:%s:%d",examPlanID,examinerID,deploymentMode);
    }

    /**
     * 获取考试计划下载session Key
     * @return
     */
    public static String getExamPlanSessionKey(String exampPlanID){
        return String.format("ExamPlan_%s",exampPlanID);
    }

    /**
     * 获取考试科目试卷下载session Key
     * @return
     */
    public static String getExamSubjectPaperSessionKey(String exampPlanID){
        return String.format("ExamSubjectPaper_%s",exampPlanID);
    }

    /**
     * 获取考试科目试卷下载完成 Key
     * @return
     */
    public static String getExamSubjectPaperCompleteKey(String exampPlanID){
        return String.format("ExamSubjectPaperComplete_%s",exampPlanID);
    }

    /**
     * 取消计划下载
     * @return
     */
    public static String getCancelDownLoadExamPlanKey(){
        return "CancelDownLoadExamPlan";
    }

    /**
     * 取消科目试卷下载
     * @return
     */
    public static String getCancelDownLoadExamSubjectPaperKey(){
        return "CancelDownLoadExamPlan";
    }

    /**
     * 保存拍照信息key
     * @param examPlanID
     * @param examinerID
     * @param examinerArrangeID
     * @return
     */
    public static String getTakePhotoMessageKey(String examPlanID,String examinerID,String examinerArrangeID){
        return String.format("%s:%s:%s",examPlanID,examinerArrangeID,examinerID);
    }
}
